package com.yellowpage.white.dao;

import java.io.Serializable;
import java.sql.Connection;
import java.util.List;
import java.util.Map;

public interface BaseDao<E, PK extends Serializable> {

	public E get(PK id);

	public List<E> getAll();

	public boolean exists(PK id);

	public boolean save(E object);

	public void save(List<E> objects);

	public void update(E object);

	public void update(List<E> objects);

	public void remove(PK id);

	public void remove(List<PK> ids);
	
	public void remove(String sql, Object[] params);

	// 通过DAO接口,为Service提供一个使用SQL进行查询的API功能
	public QueryAssistantSQL newQueryAssistantSQL(String sql);

	public Connection getConnection();

	public List<E> getObjectListByConditions(String sql,
			Object[] conditionValueList);
	
	
	public List<Map> query(final String finalSql , Map queryMap);
    public List<Map> query(final QueryAssistantSQL sqlAssistant , Map queryMap);	
	
}
